package com.shujia.flink.source;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class Demo02SocketSource {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        /**
         * Socket Source：
         * 一般用于代码调试及开发
         */
        DataStream<String> socketDS = env.socketTextStream("master", 8888);
        socketDS.print();

        env.execute();

    }
}
